package cn.miju.admin.system.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * <pre>
 * 获取系统菜单列表
 * </pre>
 *
 * @author zhuming
 * @version 1.0.0
 * @since 2023-03-29 11:53
 */
@Data
@ApiModel
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MenuListOutVO {
    /**
     * 菜单资源
     */
    @ApiModelProperty(value = "菜单资源")
    private List<MenuInfo> menus;
    /**
     * 已授权角色菜单ID列表
     */
    @ApiModelProperty(value = "已授权角色菜单ID列表")
    private List<Long> roleMenuIds;
    @Data
    public static class MenuInfo {
        /**
         * 菜单ID
         */
        @ApiModelProperty(value = "菜单ID")
        private Long id;
        /**
         * 名称
         */
        @ApiModelProperty(value = "名称")
        private String name;
        /**
         * 路径
         */
        @ApiModelProperty(value = "路径")
        private String path;
        /**
         * 元件
         */
        @ApiModelProperty(value = "元件")
        private String component;
        /**
         * 元信息
         */
        @ApiModelProperty(value = "元信息")
        private Meta meta;
        /**
         * 子菜单列表
         */
        @ApiModelProperty(value = "子菜单列表")
        private List<MenuInfo> children;
    }

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Meta {
        /**
         * 标题
         */
        @ApiModelProperty(value = "标题")
        private String title;
        /**
         * 类型
         */
        @ApiModelProperty(value = "类型")
        private String type;
        /**
         * 图标
         */
        @ApiModelProperty(value = "图标")
        private String icon;
    }
}
